﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Microsoft.Surface.Presentation;
using Microsoft.Surface.Presentation.Controls;
using Microsoft.Surface.Presentation.Input;

namespace BoardGamePlayer
{
    /// <summary>
    /// Interaction logic for Counter.xaml
    /// </summary>
    public partial class Counter : ScatterViewItem
    {
        private int count;
        public Counter()
        {
            InitializeComponent();
            Count = 0;
        }

        public int Count 
        {
            get { return count; }
            set 
            { 
                count = value;
                CounterLabel.Content = value.ToString();
            }
        }

        private void IncrementButton_Click(object sender, RoutedEventArgs e)
        {
            Count++;
        }

        private void DecrementButton_Click(object sender, RoutedEventArgs e)
        {
            Count--;
        }

        protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
        {
            BeginDragDrop(this);
            base.OnManipulationStarted(e);
        }
    }
}
